package com.hui.platform.falseworkapi.common.security.base;

import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**
 * 用户信息提供者
 *
 * @author hui
 * @date 2019/12/13
 */
public interface IUserDetailsProvider {

    /**
     * 提供用户细节
     *
     * @param username 认证字符串
     * @return 用户细节
     */
    UserDetails loadUserByUsername(String username) throws UsernameNotFoundException;


    /**
     * 是否支持改username，用于匹配规则
     *
     * @param username username
     * @return
     */
    boolean supported(String username);
}
